package com.stox.core.util;

import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class AsyncUtil {

	public static void execute(int threadCount, List<Runnable> runnables){
		ExecutorService executor = Executors.newFixedThreadPool(100);
		for(Runnable runnable : runnables){
			executor.execute(runnable);
		}
		executor.shutdown();
		while (!executor.isTerminated()) {
			Thread.yield();
		}
	}
	
}
